import {request} from "@/network/request";

//增加评论
export function insertComment(articleId, parentCommentId, content, userId) {
  return request({
    url: '/comment/insertComment',
    method: 'post',
    data: {
      articleId,
      parentCommentId,
      content,
      userId
    }
  })
}

//获取文章的评论
export function listCommentVo(pageNo, pageSize, articleId) {
  return request({
    url: '/comment/listCommentVo',
    params: {
      pageNo,
      pageSize,
      articleId
    }
  })
}

//删除评论
export function deleteComment(commentId) {
  return request({
    url: '/comment/deleteComment',
    method: 'delete',
    params: {
      commentId
    }
  })
}

//更新置顶状态
export function updateCommentTop(commentId, top) {
  return request({
    url: '/comment/updateCommentTop',
    method: 'post',
    params: {
      commentId,
      top
    }
  })
}